package com.hm.prac8;

import java.util.ArrayList;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Scanner sc = new Scanner(System.in);
        while(true){
            System.out.println("请输入成绩");
            Integer i = sc.nextInt();
            if(i==-1){
                break;
            }
            list.add(i);
        }
        int max=list.getFirst();
        for (Integer integer : list) {
            int num=integer;
            if(max<num){
                max=num;
            }
        }
        sc.close();
        System.out.println("最高成绩为"+max);
    }
}
